<?php include('../classes/class.Connection.php'); ?>
<?php
    $showUser = new User();
    $result = $showUser->selectUser();
    $request = array();

    while ($data = mysql_fetch_object($result))
    {
        $request[] = array(
                'id'=> $data->USER_id,
                'username' => $data->USER_username,
                'name' => $data->USER_lastname.", ".$data->USER_firstname
        );        
        
    }
?>
<div>
    <h3>Edit User</h3>
    Select user: <select id="sel-user" name="sel-user" class="span3" >
                <?php foreach ($request as $u) : ?>

                        <option value="<?php echo $u['username']; ?>"><?php echo $u['name']; ?></option>
                        
                <?php endforeach; ?>
                </select>
    <form id="form-add-user" method="post">
        <table class="table">
            <tbody>
                
                <tr>
                    <td colspan="3"><label class="font15">Name</label></td>
                </tr>
                
                <tr>
                    <td>
                        <input type="text" class="span3" id="last-name" name="last-name" placeholder="Last name" />
                        <br />Last name
                    </td>
                    <td>
                        <input type="text" class="span3" id="first-name" name="first-name" placeholder="First name" />
                        <br />First name
                    </td>
                    <td>
                        <input type="text" class="span3" id="middle-name" name="middle-name" placeholder="Middle name" />
                        <br />Middle name
                    </td>
                </tr>
                <tr>
                    <td>
                        <input type="text" class="span2" id="email" name="email" placeholder="Email" />
                        &nbsp;&nbsp;@&nbsp;&nbsp;
                        <select name="provider">
                            <option value="yahoo.com">yahoo.com</option>
                            <option value="yahoo.com.ph">yahoo.com.ph</option>
                            <option value="gmail.com">gmail.com</option>
                            <option value="gmail.com.ph">gmail.com.ph</option>
                        </select>
                    </td>
                    <td>
                        <input type="text" id="user-name" name="user-name" placeholder="User name" /> User name
                    </td>
                    <td></td>
                </tr>
                <tr>
                    <td>Gender: <br/>
                        <select id="gender" name="gender">
                            <option value="Male" >Male</option>
                            <option value="Female" >Female</option>
                        </select>
                    </td>
                    <td colspan="2">
                        Address:<br />
                        <input type="text" class="span5" id="address" name="address" />
                    </td>
                </tr>
                
                <tr>
                    <td>
                        Department<br />
                        <select class="span3" id="department" name="department" >
                            <option value="Mayor's Office" >Mayor's Office</option>
                            <option>Treasurer's Office</option>
                            <option>Human Resources</option>
                        </select>
                    </td>
                    <td>
                        Position<br />
                        <select class="span3" id="position" name="position" >
                            <option value="???">???</option>
                            <option>???</option>
                            <option>???</option>
                        </select>
                    </td>
                </tr>
                
                <tr>
                    <td colspan="3">Authentication Level
                        <br />
                        <select class="span3" id="auth-level" name="auth-level" >
                            <option value="level1" >Level1</option>
                            <option value="level2" >Level2</option>
                            <option value="level3" >Level3</option>
                        </select>
                    </td>
                    
                </tr>
                
                <tr>
                    <td colspan="3">
                        <input type="button" id="btn-update-user" value="UPDATE USER" class="btn btn-green" />
                        <input type="reset" value="CANCEL" class="btn btn-blue" />
                    </td>
                </tr>
                
            </tbody>
        </table>
    </form>
    <div id="message"></div>
</div>
<script>
    $(document).ready(function(){
        //$('#btn-add-user').click(function(){
        //    $.post('../resources/actions/act-add-user.php',$('#form-add-user').serialize(), function(data) {
        //        $('#message').html(data).fadeIn('normal');
        //    }); 
        //});
        $('#sel-user').change(function(){
           
        });
  
       
    });
</script>